package cn.devices.mapper;

import cn.devices.entity.TbEvent;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 告警事件表 Mapper 接口
 * </p>
 *
 * @author 秋水浮萍
 * @since 2021-02-07
 */
@Repository
public interface TbEventMapper  {

    @Select("select * from tb_event order by event_time desc")
    List<TbEvent> eventList();

    @Insert("insert into tb_event(event_id, event_time, event_desc, send_msg,  device_code)\n" +
            " value (#{eventId},#{eventTime},#{eventDesc},#{sendMsg},#{deviceCode})")
    int eventAdd(TbEvent event);

}
